Skip to content

Evaluate hashicorp/raft upstream migration#59

Merged
renecannao merged 1 commit intomasterfrom
issue56-raft-evaluation
Mar 24, 2026
Merged

Evaluate hashicorp/raft upstream migration#59
renecannao merged 1 commit intomasterfrom
issue56-raft-evaluation

Conversation

@renecannao
Copy link
Copy Markdown

Summary

  • Adds docs/raft-evaluation.md with a detailed analysis of migrating from openark/raft (2017 fork) to upstream hashicorp/raft v1.7+
  • Catalogs all 10 divergent API calls with migration paths and effort estimates
  • Assesses security risk of staying on the unmaintained fork
  • Recommends migration to upstream (estimated 3-5 days of effort)

Key findings

  • 10 divergent APIs identified, ranging from trivial (type conversion) to significant (SnapshotStore.Create() signature change)
  • Custom RelationalStore (LogStore/StableStore) is fully compatible with upstream -- zero changes needed
  • Security risk is high: 9 years of upstream fixes missing, including pre-vote protocol, race condition fixes, and snapshot improvements
  • Total effort estimate: ~32 hours (3-5 working days)

Test plan

  • Review evaluation document for completeness and accuracy
  • Validate API divergence claims against upstream hashicorp/raft v1.7 source
  • Confirm effort estimates with team

Closes #56

Detailed analysis of divergence between openark/raft (2017 fork) and
upstream hashicorp/raft v1.7+. Catalogs 10 divergent API calls,
assesses security risk, estimates migration effort at 3-5 days, and
recommends migrating to upstream.

Closes #56
Copilot AI review requested due to automatic review settings March 24, 2026 11:56
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

Warning

Rate limit exceeded

@renecannao has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 48 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a39c1c40-29ae-4397-b80d-f1bd4bcaca80

📥 Commits

Reviewing files that changed from the base of the PR and between 5740466 and 170fbb0.

📒 Files selected for processing (1)
  • docs/raft-evaluation.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue56-raft-evaluation

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a comprehensive analysis document to evaluate the migration from an outdated openark/raft fork to the actively maintained hashicorp/raft upstream. This evaluation highlights critical security vulnerabilities and maintenance issues associated with the current fork, details the necessary API changes, and provides a clear recommendation and effort estimate for the migration, aiming to enhance system security and maintainability.

Highlights

  • Raft Upstream Migration Evaluation: A new document, docs/raft-evaluation.md, has been added which provides a detailed analysis of migrating from the openark/raft fork (from 2017) to the upstream hashicorp/raft v1.7+.
  • Divergent API Catalog: The evaluation identifies 10 divergent API calls between the current fork and upstream hashicorp/raft, detailing their migration paths and estimated effort.
  • Security Risk Assessment: The document assesses a high security risk due to the current use of an unmaintained, nine-year-old fork, highlighting missing security patches and bug fixes from upstream.
  • Migration Recommendation and Effort: The evaluation recommends migrating to upstream hashicorp/raft v1.7.x, estimating the total effort at approximately 32 hours (3-5 working days).
  • Custom Implementations Compatibility: It notes that the custom RelationalStore (LogStore/StableStore) is fully compatible with upstream, while the FileSnapshotStore requires significant updates due to a critical Create() method signature change.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a comprehensive evaluation document for migrating from a forked hashicorp/raft to the upstream version. The analysis is thorough and well-structured, providing a strong case for the migration. My review focuses on improving the clarity and accuracy of this new documentation. I've pointed out a few areas for improvement: clarifying the age of the fork to avoid confusion, correcting a technical description of the custom Yield() API, and fixing a structural error where a compatible API was listed under 'Removed APIs'.

Comment thread docs/raft-evaluation.md

## Executive Summary

Orchestrator depends on `openark/raft`, a 2017-era fork of `hashicorp/raft` pinned at commit `fba9f909f7fe` (September 2017). The fork diverges significantly from upstream `hashicorp/raft` v1.7+, which has undergone nine years of active development including security fixes, performance improvements, and major API changes.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The document, dated 2026, repeatedly refers to the 2017 fork as being 'nine years' old. While this is consistent with the document's date, it may be confusing for present-day readers. To improve clarity and make the document more timeless, consider phrasing the age relative to the fork date, for example: '...undergone many years of active development since 2017...'. This phrasing is also more robust against the passage of time. This point applies to lines 9, 172, 176, 229, and 262.

Comment thread docs/raft-evaluation.md
#### `raft.Raft.Yield()`

- **Location:** `raft.go:284`
- **What it does:** Causes the leader to voluntarily step down in favor of a specific peer. This is a custom addition in the openark fork, not present in standard hashicorp/raft.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The description for raft.Raft.Yield() says it causes the leader to step down 'in favor of a specific peer'. This is slightly inaccurate. The underlying raft.Yield() implementation in the fork performs a non-targeted step-down and temporarily suspends its own leadership candidacy. The FSM logic calling it has a target peer, but only to avoid yielding to itself. Clarifying this distinction would make the comparison with upstream's targeted LeadershipTransferToServer more precise.

Comment thread docs/raft-evaluation.md
Comment on lines +109 to +114
#### `raft.Raft.LeaderCh()`

- **Location:** `raft.go:154`
- **What it does:** Returns a channel that signals leadership changes.
- **Upstream status:** `LeaderCh()` still exists in upstream v1.7.x.
- **Migration effort:** **None.** API is compatible.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The raft.Raft.LeaderCh() API is listed under section '2.1 Removed APIs', but its description correctly states that it is compatible with upstream. This is confusing. To improve clarity, this section should be removed, as the API is already correctly listed as compatible in the table in section 2.2.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an evaluation document assessing migration from the github.com/openark/raft fork (via go.mod replace) to upstream github.com/hashicorp/raft v1.7.x, documenting API divergences, risk tradeoffs, and a rough effort estimate to guide future migration work.

Changes:

  • Added docs/raft-evaluation.md with a catalog of raft API divergences and proposed migration paths.
  • Included a security/risk assessment for staying on the 2017 fork versus migrating upstream.
  • Provided a task breakdown and suggested migration order.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread docs/raft-evaluation.md
| `raft.Log` struct | `fsm.go:33`, `rel_store.go:179,196,201` | Compatible |
| `raft.FSMSnapshot` interface | `fsm.go:84` | Compatible |
| `raft.SnapshotSink` interface | `fsm_snapshot.go:35` | Compatible |
| `raft.SnapshotMeta` struct | `file_snapshot.go:55,137,154,191,199,273` | Compatible (but `Peers` field changed to `Configuration`) |
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the “Compatible APIs” table, raft.SnapshotMeta is marked as “Compatible” even though the note says the Peers field changes to Configuration upstream. Since this field is used by FileSnapshotStore today, this is a migration-breaking divergence; consider moving this row to the divergent section or changing the status to make it clear code changes are required.

Suggested change
| `raft.SnapshotMeta` struct | `file_snapshot.go:55,137,154,191,199,273` | Compatible (but `Peers` field changed to `Configuration`) |
| `raft.SnapshotMeta` struct | `file_snapshot.go:55,137,154,191,199,273` | Divergent – `Peers` field replaced by `Configuration`; migration requires code changes in `FileSnapshotStore`. |

Copilot uses AI. Check for mistakes.
@renecannao renecannao merged commit c81e05e into master Mar 24, 2026
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Evaluate hashicorp/raft upstream migration

2 participants